/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exatrez.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author wan.fairul
 */
@Entity
@Table(name = "task_summary")
@NamedQueries({
    @NamedQuery(name = "TaskSummary.findAll", query = "SELECT t FROM TaskSummary t")})
public class TaskSummary implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "task_summary_id")
    private Integer taskSummaryId;
    @Column(name = "personal_task_id")
    private Integer personalTaskId;
    @Column(name = "from_user")
    private String fromUser;    
    @Column(name = "message")
    private String message;
    @Column(name = "date_submit")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateSubmit;
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "task_folder_id")
    private Folder folder;

    public TaskSummary() {
    }

    public TaskSummary(Integer taskSummaryId) {
        this.taskSummaryId = taskSummaryId;
    }

    public Integer getTaskSummaryId() {
        return taskSummaryId;
    }

    public void setTaskSummaryId(Integer taskSummaryId) {
        this.taskSummaryId = taskSummaryId;
    }

    public Integer getPersonalTaskId() {
        return personalTaskId;
    }

    public void setPersonalTaskId(Integer personalTaskId) {
        this.personalTaskId = personalTaskId;
    }   

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Date getDateSubmit() {
        return dateSubmit;
    }

    public void setDateSubmit(Date dateSubmit) {
        this.dateSubmit = dateSubmit;
    }

    public Folder getFolder() {
        return folder;
    }

    public void setFolder(Folder folder) {
        this.folder = folder;
    }

    public String getFromUser() {
        return fromUser;
    }

    public void setFromUser(String fromUser) {
        this.fromUser = fromUser;
    }   
    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (taskSummaryId != null ? taskSummaryId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TaskSummary)) {
            return false;
        }
        TaskSummary other = (TaskSummary) object;
        if ((this.taskSummaryId == null && other.taskSummaryId != null) || (this.taskSummaryId != null && !this.taskSummaryId.equals(other.taskSummaryId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "exatrez.model.TaskSummary[ taskSummaryId=" + taskSummaryId + " ]";
    }
    
}
